cmake_minimum_required(VERSION 3.20)

# set(i 0)
# while(i LESS 10)
#     message("i = ${i}")
#     math(EXPR i "${i}+1")
# endwhile()

# -- 1.foreach items
# foreach(it 1;2;3)
# foreach(it 1 2 3)
#     message(STATUS "${it}")
# endforeach()

#  -- 2.foreach RANGE
# foreach(it RANGE -5)
#     message(STATUS ${it})
# endforeach()

# -- 3.foreach list + items
# set(str1 "CMake" "Arch" "Linux")
# set(str2 "1" "2" "3")
# # foreach(it IN LISTS str1 str2)
# foreach(it IN LISTS str1 str2 ITEMS "a b " c d ${str1})
#     message(STATUS "${it}")
# endforeach()

# -- 4.foreach zip-lists
set(English "One" "Two" "Three")
set(Arabic 1 2 3 4)
set(Chinese "一" "二" "三" "四" "五")
    # -- 方式1
# foreach(it IN ZIP_LISTS English Arabic Chinese)
#     message(STATUS "English = ${it_0}\tArabic = ${it_1}\tChinese = ${it_2}")
# endforeach()
    # -- 方式2
foreach(en ar ch IN ZIP_LISTS English Arabic Chinese)
    message(STATUS "English = ${en}\tArabic = ${ar}\tChinese = ${ch}")
endforeach()


